#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>

#define SIZE 1024
#define SYNC_NOW 1
#define SYNC_LINE 2
#define SYNC_FULL 4

typedef struct _FILE
{
    int flag;
    int fileno;
    int cap;
    int size;
    char buffer[SIZE];
}FILE_;


FILE_* fopen_(const char* path_name, const char* mode);
void fwrite_(const char* ptr, int num, FILE_* fp);
void flush_(FILE_* fp);
void fclose_(FILE_* fp);
